package chapter3.No3_1_等待和通知机制.l通过管道进行线程间通信_字符流;

import java.io.IOException;
import java.io.PipedWriter;

/**
 * Created by Administrator on 2016/11/20.
 */
public class WriteData {

    public void writeMethod(PipedWriter pw) {
        try {
            System.out.println("输入：");
            for (int i = 0; i < 10; i++) {
                String value = i + ",";
                System.out.print(value);
                pw.write(value);
            }
            System.out.println();
            pw.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
